package com.youlian.cloud.system.config.aspect;

import com.youlian.cloud.log.asepct.CatDaoAscept;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * dao层AOP拦截器定义
 *
 * @author Liuhx
 * @create 2018-06-14 11:28
 * @email liuhx@elab-plus.com
 **/
@Aspect
@EnableAspectJAutoProxy
@Configuration
public class DaoAspectBean {
    @Bean
    public CatDaoAscept getDaoAspect() {
        CatDaoAscept daoAspect = new CatDaoAscept();
        return daoAspect;
    }

    @Around(value = "execution(* com.youlian.cloud.system.dao..*(..))")
    public Object around(ProceedingJoinPoint pjp) throws Throwable {
        return getDaoAspect().around(pjp);
    }
}